<table class="table table-border table-bordered table-hover table-bg mt-20">
    <thead>
    <tr class="text-c">
        <th width="">+</th>
        <th width="">id</th>
        <th width="">产品ID</th>
        <th width="">订单ID</th>
        <th width="">订单处理状态</th>
        <th width="">预订人</th>
        <th width="">预订人电话</th>
        <th width="">姓名</th>
        <th width="">年龄</th>
        <th width="">出发日期</th>
        <th width="">手机</th>
        <th width="">身份证</th>
        <th width="">平台</th>
        <th width="">性别</th>
        <th width="">订单</th>
        <th width="">车调处理</th>
        <th width="">房调处理</th>
        <th width="">住宿</th>
        <th width="">备注</th>
        <th colspan="2" width="70">操作</th>
    </tr>
    </thead>
    <tbody>
    {volist name="list" id="vo"}
    <tr class="text-c">
        <td class="open">
            {if condition="$vo.show_mian"}
            <p>+</p><div></div>
            {elseif  condition="$vo.show_between" /}
            <span></span><i></i>
            {elseif  condition="$vo.show_end" /}
            <span></span>
            {/if}
        </td>
        <td>{$vo.id}</td>
        <td>{$vo.sales_id}</td>
        <td>{$vo.order_id}:{$vo.sku_name}</td>
        <td>
            {php}
            if ($vo['vehicle_adjustment'] == '' && $vo['room_adjustment'] == ''){
            $vo['order_processing_status'] = '正常';
            }elseif ($vo['vehicle_adjustment'] == 'Pending disposal' || $vo['room_adjustment'] == 'Pending disposal'){
            $vo['order_processing_status'] = '待确认';
            }elseif ($vo['vehicle_adjustment'] == 'Processed' && $vo['room_adjustment'] == 'Processed'){
            $vo['order_processing_status'] = '已修改';
            }elseif ($vo['vehicle_adjustment'] == 'Processed' && $vo['room_adjustment'] == ''){
            $vo['order_processing_status'] = '已修改';
            }elseif ($vo['vehicle_adjustment'] == '' && $vo['room_adjustment'] == 'Processed'){
            $vo['order_processing_status'] = '已修改';
            }
            echo $vo['order_processing_status'];
            {/php}
        </td>
        <td>{$vo.booking_people_name}</td>
        <td>{$vo.booking_people_phone}</td>
        <td class="oid_{$vo.oid} traveler_{$vo.id}" data-traveler_id="{$vo.id}" data-traveler_name="{$vo.name}">{$vo.name}</td>
        <td>{$vo.age}</td>
        <td>{:date('Y-m-d',$vo.start_time)}</td>
        <td>{$vo.phone}</td>
        <td>{$vo.id_card}</td>
        <!--新增备注-20190121-->
        <td class="f-14">
            <?php
                if($platform){
                    foreach($platform as $k=>$v){
                    if($v['platform_name'] == $vo['platform']){
                        $plate = $v['name'];
                        }
                    }
                }else{
                    $plate = '';
                }
                ?>
            <?php echo $plate;?>
        </td>
        <td>{$vo.sex}</td>
        <td>{$vo.title}</td>
        <td>
            {switch name="$vo.vehicle_adjustment"}
            {case value="Pending disposal"}待处理{/case}
            {case value="Processed"}已处理{/case}
            {/switch}
        </td>
        <td>
            {switch name="$vo.room_adjustment"}
            {case value="Pending disposal"}待处理{/case}
            {case value="Processed"}已处理{/case}
            {/switch}
        </td>
        <td>{$vo.isaccommodation}{$vo.accommodation}</td>
        <td>{$vo.remark}</td>
        <td>
            {if condition="$vo.show_mian"}
            <input class="checkbox_oid checkbox_{$vo.oid}" data-oid="{$vo.oid}" type="checkbox" name="oid[]" value="{$vo.oid}">
            {elseif  condition="$vo.show_single" /}
            <input class="checkbox_oid checkbox_{$vo.oid}" data-oid="{$vo.oid}" type="checkbox" name="oid[]" value="{$vo.oid}">
            {/if}
        </td>
        <td class="f-14">
            <!--{$vo.status|show_status=$vo.id}-->
            {tp:menu menu='sedit' /}
            {if condition="$vo.show_mian"}
            <a title="订单信息" href="javascript:;" onclick="layer_open('订单信息','/admin/order/edit/id/{$vo.oid}.html')" style="text-decoration:none" class="label label-warning radius">订单信息</a>
            {elseif  condition="$vo.show_single" /}
            <a title="订单信息" href="javascript:;" onclick="layer_open('订单信息','/admin/order/edit/id/{$vo.oid}.html')" style="text-decoration:none" class="label label-warning radius">订单信息</a>
            {/if}
            <!--{tp:menu menu='sdelete' /}-->
        </td>
    </tr>
    {/volist}
    </tbody>
</table>
<div class="page-bootstrap">{$page ?? ''}</div>

<?php
    //if($refresh){
    //echo 'ajax穿过来的值：'.$refresh;
        //dump('refresh');
    //}
?>
{if condition="$refresh eq 1"}
<script>
    $(function () {
        $(".checkbox_oid").click(function () {
            var selected_box=$(".selected_box");//length
            if(selected_box.length>0){
                selected_box=selected_box.eq(0);
            }else{
                selected_box=null;
            }
            var oid=$(this).data('oid');
            var travelers=$(".oid_"+oid);
            var checked=$(this).is(":checked");//选中，返回true;没选中，返回false;
            // console.log('你选中的订单id是', oid);
            if(checked){
                if(selected_box){
                    $(travelers).each(function () {
                        var traveler_id=$(this).data('traveler_id');
                        var traveler_name=$(this).data('traveler_name');
                        $(selected_box).append('<span class="traveler traveler_id_'+traveler_id+' traveler_oid_'+oid+'" data-traveler_id="'+traveler_id+'" data-traveler_oid="'+oid+'">'+traveler_name+'</span>');
                    })

                }else{
                    $('.listBox').append('<div class="list selected_box"><div class="delete">×</div><p class="driver driver_0" data-user_id="0">选择司机</p></div>');
                    selected_box=$(".selected_box").eq(0);
                    $(travelers).each(function () {
                        var traveler_id=$(this).data('traveler_id');
                        var traveler_name=$(this).data('traveler_name');
                        $(selected_box).append('<span class="traveler traveler_id_'+traveler_id+' traveler_oid_'+oid+'" data-traveler_id="'+traveler_id+'" data-traveler_oid="'+oid+'">'+traveler_name+'</span>');
                    })
                }
            }else{
                $(".traveler_oid_"+oid).remove();
            }
        });
    });
</script>
{/if}